using System;
using System.Collections.Generic;
using System.Text;

namespace Zsa.Emulation.Render
{
    /// <summary>
    /// Setting for the render object.
    /// </summary>
    [Serializable()]
    public class RenderSettings : ICloneable, IEquatable<RenderSettings>
    {
        #region Fields
        /// <summary>
        /// The graphics render settings.
        /// </summary>
        private Video.GraphicRenderSettings _GraphicsSettings;

        /// <summary>
        /// The audio render settings.
        /// </summary>
        private Audio.SoundDeviceSettings _AudioSettings;

        /// <summary>
        /// The controller settings.
        /// </summary>
        private Input.ControllerSettings _InputSettings;
        #endregion Fields

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="T:RenderSettings"/> class.
        /// </summary>
        /// <param name="graphicsRender">The graphics render.</param>
        /// <param name="audioSettings">The audio settings.</param>
        /// <param name="controllerSettings">The controller settings.</param>
        public RenderSettings(Video.GraphicRenderSettings graphicsRender,
            Audio.SoundDeviceSettings audioSettings,Input.ControllerSettings controllerSettings )
        {
            _GraphicsSettings = graphicsRender;
            _AudioSettings = audioSettings;
            _InputSettings = controllerSettings;
        }
        #endregion Constructors

        #region Properties
        /// <summary>
        /// Gets or sets the graphics settings.
        /// </summary>
        /// <value>The graphics settings.</value>
        public Video.GraphicRenderSettings GraphicsSettings
        {
            get
            {
                return _GraphicsSettings;
            }
            set
            {
                _GraphicsSettings = value;
            }
        }

        /// <summary>
        /// Gets or sets the audio settings.
        /// </summary>
        /// <value>The audio settings.</value>
        public Audio.SoundDeviceSettings AudioSettings
        {
            get
            {
                return _AudioSettings;
            }
            set
            {
                _AudioSettings = value;
            }
        }
        /// <summary>
        /// Gets or sets the input settings.
        /// </summary>
        /// <value>The input settings.</value>
        public Input.ControllerSettings InputSettings
        {
            get
            {
                return _InputSettings;
            }
            set
            {
                _InputSettings = value;
            }
        }
        #endregion Properties

        #region Methods
        /// <summary>
        /// Clones this instance.
        /// </summary>
        /// <returns></returns>
        public RenderSettings Clone()
        {
            return new RenderSettings(
                _GraphicsSettings.Clone(),
                _AudioSettings.Clone(),
                _InputSettings.Clone()
            );
        }

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        /// A new object that is a copy of this instance.
        /// </returns>
        object ICloneable.Clone()
        {
            return Clone();
        }


        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <param name="other">An object to compare with this object.</param>
        /// <returns>
        /// true if the current object is equal to the other parameter; otherwise, false.
        /// </returns>
        public bool Equals(RenderSettings other)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion Methods
    }
}
